<template>
  <a class="article-card-mini">
    <div class="head">
      <img :src="img" alt="">
    </div>
    <div class="bottom">
      <div class="bottom-left">
        <span>{{ title }}</span>
      </div>
      <div class="bottom-right">
        <div>
          <el-icon size="20"><Star /></el-icon> {{ like }}
          <el-icon size="20"><ChatLineRound /></el-icon> {{ comments }}
        </div>
        <div>
          <el-icon size="20"><UserFilled /></el-icon>
          <el-button type="danger" size="small">{{ name }}</el-button>
        </div>
      </div>
    </div>
  </a>
</template>

<script setup>
defineProps({
  title: {
    type: String,
    default: 'Title'
  },
  like: {
    type: Number,
    default: 0
  },
  comments: {
    type: Number,
    default: 0
  },
  name: {
    type: String,
    default: 'Unknown'
  },
  img: {
    type: String,
    default: 'https://sam-1306698532.cos.ap-nanjing.myqcloud.com/pic/bg1.png'
  }
})
</script>

<style scoped>
.article-card-mini {
  display: block;
  height: calc(100% - 20px);
  width: calc(100% - 20px);
  margin: 10px;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: .25rem;
  box-shadow: var(--el-box-shadow);
  transition: all 0.2s ease-in-out 0.2s;
}
.article-card-mini:hover{
  margin-top: 5px;
}
.head {
  height: 70%;
  width: 100%;
  border-radius: .25rem;
  overflow: hidden;
}
.head > img {
  height: 100%;
  width: 100%;
}
.bottom {
  height: 30%;
  width: 100%;
}
.bottom-left {
  height: 100%;
  width: 70%;
  float: left;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bottom-left > span {
  max-width: 80%;
	max-height: 80%;
  font-size: 20px;
  font-weight: 500;
  line-height: 30px;
  text-align: center;
  overflow-y: auto;
  overflow-x: hidden;
}
.bottom-left > span::-webkit-scrollbar {
  width: 3px !important;
}
.bottom-right {
  height: 100%;
  width: 30%;
  float: left;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.bottom-right > div {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
  align-items: center;
}
</style>